import Vue from 'vue';
import App from './App';
import store from '@/store/index'
Vue.config.productionTip = false;
App.mpType = 'app'
// 引入全局uView
import uView from "uview-ui";
Vue.use(uView);
uni.$u.setConfig({
	// 修改$u.config对象的属性
	config: {
		// 修改默认单位为rpx，相当于执行 uni.$u.config.unit = 'rpx'
		unit: 'rpx'
	},
	// 修改$u.props对象的属性
	props: {
		// 修改radio组件的size参数的默认值，相当于执行 uni.$u.props.radio.size = 30
		// 其他组件属性配置
		// ......
	},
})
Vue.use(store);
const app = new Vue({
	...App,
	store
})
// 引入请求封装，将app参数传递到配置中
require('@/common/http.interceptor.js')(app)
import httpApi from '@/common/http.api.js';
Vue.use(httpApi, app);
import navbar from '@/components/navbar';
Vue.component('door-navbar', navbar)
import modal from '@/components/modal';
Vue.component('door-modal', modal)
import tabbar from '@/components/tabbar';
Vue.component('door-tabbar', tabbar)
import empty from '@/components/empty';
Vue.component('door-empty', empty)
import imageVerify from '@/components/imageVerify';
Vue.component('imageVerify', imageVerify)
import uniCombox from '@/components/uni-combox';
Vue.component('uni-combox', uniCombox)
import uniDataChecklist from '@/components/uni-data-checkbox';
Vue.component('uni-data-checkbox', uniDataChecklist)
app.$mount();

//全局公用函数
import {
	api
} from '@/common/api.js';
Vue.prototype.$api = api
//const webBaseUrl = 'http://121.41.116.2:9889';//正式 121.40.177.177:8081
const webBaseUrl = 'http://121.41.116.2:9889';//测试
Vue.prototype.$webBaseUrl = webBaseUrl;
Vue.prototype.$copy = (e) => {
	uni.setClipboardData({
		data: e, //要被复制的内容
		success: () => { //复制成功的回调函数
			uni.showToast({ //提示
				title: "复制成功"
			})
		}
	});
}
uni.getSystemInfo({
	success: function(res) {
		Vue.prototype.$windowWidth = res.windowWidth
	}
});
